home *** CD-ROM | disk | FTP | other *** search
- { %appName%.p -- Main }
- { Created %date% %time% by AppMaker }
-
- Program %appName%;
- %if lang = Think%
- {$I-}
- %end if%
-
- Uses
- %if lang = MPW%
- Types,
- Quickdraw,
- Controls,
- Dialogs,
- Events,
- Lists,
- Menus,
- SegLoad,
- StandardFile,
- TextEdit,
-
- %end if%
- Globals,
- ResourceDefs,
- EventLoop,
- FileM,
- Miscellany;
-
- %if lang = MPW%
- {$D+}
- {$R+}
- {$OV+}
-
- %end if%
- var
- finderMessage: integer;
- nrDocs: integer;
-
- {----------}
- Procedure PrintDocuments;
- Begin
- Acknowledge (CantPrintID);
- End; {PrintDocuments}
-
- {----------}
- Procedure OpenDocuments;
- var
- N: integer;
- nrOpened: integer;
- docInfo: AppFile;
- Begin
- nrOpened := 0;
- for N := 1 to nrDocs do begin
- GetAppFiles (N, docInfo);
- with docInfo do begin
- if OkToOpen (fType) then begin
- OpenDoc (fName, vRefNum);
- nrOpened := nrOpened + 1;
- end else begin
- ParamText (fName, '', '', '');
- Acknowledge (WrongTypeID);
- end;
- end; {with}
- ClrAppFiles (N);
- end; {for}
- if nrOpened = 0 then begin
- OpenApp;
- end;
- End; {OpenDocuments}
-
- {----------}
- Begin {%appName%}
- Initialize;
- CountAppFiles (finderMessage, nrDocs);
- if nrDocs > 0 then begin
- if finderMessage = AppPrint then begin
- PrintDocuments;
- end else begin
- OpenDocuments;
- MainLoop;
- end;
- end else begin
- if sysConfig.hasAppleEvents then begin
- {wait for OApp, ODoc, or PDoc AppleEvent}
- end else begin
- OpenApp;
- end;
- MainLoop;
- end;
- End. {%appName%}
-